package com.jxwifi.cloud.quickclean.adapter;

import android.support.annotation.LayoutRes;
import android.support.annotation.Nullable;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.jxwifi.cloud.quickclean.R;
import com.jxwifi.cloud.quickclean.bean.AddressTypeBean;

import java.util.List;

public class AddressTypeAdapter extends BaseQuickAdapter<AddressTypeBean, BaseViewHolder> {


    public AddressTypeAdapter(@LayoutRes int layoutResId, @Nullable List data) {
        super(layoutResId, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, AddressTypeBean item) {
             helper.setText(R.id.tv_address_label,item.getTypeName());
             if (item.isCheck()){
                 helper.getView(R.id.tv_address_label).setBackgroundResource(R.drawable.shap_client_tag_default);
             }else{
                 helper.getView(R.id.tv_address_label).setBackgroundResource(R.drawable.shap_client_tag_bg);
             }
        helper.addOnClickListener(R.id.tv_address_label);
    }
}
